﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Vehicle.DAL
{
    /// <summary>
    /// Copyright (C) M-Tear团队
    /// 文 件 名：Cargo.cs
    /// 版    本：v1.00.0000
    /// 创建标识：2009-09-01    Created by 杨光远 V1.00.0000
    /// 功能说明：Cargo表数据层类（继承于数据层基类)
    /// 注意事项：无
    /// 
    /// 更新记录：
    /// 
    /// </summary>
  public  class Cargo: DAL.Base_DAL, Vehicle.Interface.ICargo
    {
        /// <summary>
        /// 绑定页面Repeater控件
        /// </summary>
        /// <param name="Rept">Repeater控件对象</param>
        /// <param name="m_ComponentsInfo">通用实体对象</param>
        public void RepeaterBind(Repeater Rept, Model.ComponentsInfo m_ComponentsInfo)
        {
            Rept.DataSource = GetAllSearch(new Model.ComponentsInfo(m_ComponentsInfo.startIndex, m_ComponentsInfo.endIndex, "Cargo", m_ComponentsInfo.condition, m_ComponentsInfo.result, m_ComponentsInfo.Tcondition, m_ComponentsInfo.Tresult, m_ComponentsInfo.Scondition, m_ComponentsInfo.Sresult, "C_Time", m_ComponentsInfo.StartTime, m_ComponentsInfo.EndTime, "C_ID")).DefaultView;
            Rept.DataBind();
        }
        /// <summary>
        /// 添加承运单信息
        /// </summary>
        /// <param name="m_CargoInfo">实体对象</param>
        public void Add(Model.CargoInfo m_CargoInfo)
        {
            string SpName = "Cargo_ADD";
            object[] _object = new object[] { 0, m_CargoInfo.C_Card,m_CargoInfo.C_weight,m_CargoInfo.C_Route,m_CargoInfo.C_Addresss,m_CargoInfo.C_contract,m_CargoInfo.C_GoodsName,m_CargoInfo.C_LoadAddr,m_CargoInfo.C_CTime,m_CargoInfo.C_StartTime,m_CargoInfo.C_EndTime ,m_CargoInfo.C_Receive,m_CargoInfo.C_Result,m_CargoInfo.C_Time,m_CargoInfo.C_AddName,m_CargoInfo.C_LastTime,m_CargoInfo.C_Fax,m_CargoInfo.C_Tel,m_CargoInfo.C_CAddress,m_CargoInfo.C_CName,m_CargoInfo.C_Contact,m_CargoInfo.C_Mobilephone,m_CargoInfo.C_HomePhone,m_CargoInfo.C_Note,m_CargoInfo.C_IsDelete,m_CargoInfo.C_Sendee,m_CargoInfo.C_STel,m_CargoInfo.C_Money};
            SqlHelper.ExecuteNonQuery(SpName, _object);
        }

        /// <summary>
        /// 修改承运单信息
        /// </summary>
        /// <param name="m_CargoInfo">实体对象</param>
        public void Update(Model.CargoInfo m_CargoInfo)
        {
            string SpName = "Cargo_Update";
            object[] _object = new object[] { 0, m_CargoInfo.C_ID, m_CargoInfo.C_Card, m_CargoInfo.C_weight, m_CargoInfo.C_Route, m_CargoInfo.C_Addresss, m_CargoInfo.C_contract, m_CargoInfo.C_GoodsName, m_CargoInfo.C_LoadAddr, m_CargoInfo.C_CTime, m_CargoInfo.C_StartTime, m_CargoInfo.C_EndTime, m_CargoInfo.C_Receive, m_CargoInfo.C_Result, m_CargoInfo.C_Time, m_CargoInfo.C_AddName, m_CargoInfo.C_LastTime, m_CargoInfo.C_Fax, m_CargoInfo.C_Tel, m_CargoInfo.C_CAddress, m_CargoInfo.C_CName, m_CargoInfo.C_Contact, m_CargoInfo.C_Mobilephone, m_CargoInfo.C_HomePhone, m_CargoInfo.C_Note, m_CargoInfo.C_IsDelete, m_CargoInfo.C_Sendee, m_CargoInfo.C_STel, m_CargoInfo.C_Money };
            SqlHelper.ExecuteNonQuery(SpName, _object);
        }
    }
}
